import request from "../request.js"

 function doLogin(data) {
 	return request({
 		url: "/lejuClient/login/doLogin",
 		method: "post",
 		data
 	})
 }

 function getMemberInfo() {
 	return request({
 		url: "/lejuClient/login/getMemberInfo",
 		method: "get"
 	})
 }

 function register(data) {
 	return request({
 		url: '/lejuClient/member/register',
 		method: "post",
 		data
 	})
 }
 //购物车列表
 function findAllCartItem() {
 	return request({
 		url: "/lejuClient/cart/findAllCartItem",
 		method: "get"
 	})
 }

 //删除
 function delCartItems(data) {
 	return request({
 		url: "/lejuClient/cart/delCartItems",
 		method: "post",
 		data
 	})
 }

 //等待确认订单详情
 function getPreOrderById(id) {
 	return request({
 		url: `/lejuClient/order/getPreOrderById/${id}`,
 		method: "get",
 		
 	})
 }
 
 //提交确认单
 function addConfirmOrder(data){
	 return request({
	 	url: "/lejuClient/order/addConfirmOrder",
	 	method: "post",
	 	data
	 })
 }
 //确认付款
 function payConfirm(data){
	 return request({
	 	url: "/lejuClient/order/payConfirm",
	 	method: "post",
	 	data
	 })
 }
 
 //更新用户信息
 function updateMemberInfo(data){
	return request({
		url: "/lejuClient/member/updateMemberInfo",
		method: "post",
		data
	})
 }
 //重置密码
 function resetPassword(data){
 	return request({
 		url:`/lejuClient/member/resetPassword/${data}`,
 		method: "post"
 	})
 }
 
 function findAllOrders(){
	return request({
		url: "/lejuClient/order/findAllOrders",
		method: "get"
	})
 }
 //申请退单列表
 function orderReturnApplys(){
	return request({
		url: "/lejuClient/orderReturn/orderReturnApplys",
		method: "get"
	})
 }
 //取消订单
 function cancelOrder(orderId){
 	return request({
 		url: `/lejuClient/order/cancelOrder/${orderId}`,
 		method: "post"
 	})
 }
 
 //查看退单明细
 function orderReturn(data){
 	return request({
 		url: `/lejuClient/orderReturn/${data}`,
 		method: "get"
 	})
 }
 
 //提交退单申请
 function addOrderReturnApply(data){
 	return request({
 		url: `/lejuClient/orderReturn/addOrderReturnApply`,
 		method: "post",
		data
 	})
 }
 
 //获取退单公司列表
 function getCompanyAddrss(){
 	return request({
 		url: `/lejuClient/orderReturn/getCompanyAddrss`,
 		method: "get"
 	
 	})
 }
 
 export {
 	doLogin,
 	getMemberInfo,
 	register,
 	findAllCartItem,
 	delCartItems,
	getPreOrderById,
	addConfirmOrder,
	payConfirm,
	updateMemberInfo,
	findAllOrders,
	orderReturnApplys,
	cancelOrder,
	orderReturn,
	addOrderReturnApply,
	getCompanyAddrss,
	resetPassword
 }
